package com.syh.bishe.mapper;

import com.syh.bishe.pojo.BjData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.syh.bishe.pojo.Pie;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author syh
 * @since 2024-07-01
 */
@Mapper
public interface BjDataMapper extends BaseMapper<BjData> {
    @Select("select * from bj_data order by date desc limit 200")
    List<BjData> select();

    @Select("select type ,sum(account) as value from bj_data WHERE type is not null group by type")
    List<Pie> getPie();
}
